//
//  YYTestObjectModel.m
//  IOSLearn
//
//  Created by Yanyan Jiang on 2019/3/21.
//  Copyright © 2019 Yanyan Jiang. All rights reserved.
//

#import "YYTestObjectModel.h"

@interface YYTestObjectModel(){
    NSString *_name;
}

@end

@implementation YYTestObjectModel

- (void)setNilValueForKey:(NSString *)key{
    NSLog(@"不能将%@设置成nil",key);
}

+ (BOOL)accessInstanceVariablesDirectly {
    return YES;
}

- (id)valueForUndefinedKey:(NSString *)key {
    NSLog(@"出现异常，该key不存在%@",key);
    return nil;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    NSLog(@"出现异常，该key不存在%@", key);
}

- (NSUInteger)isAge{
    return 10;
}

- (BOOL)validateValue:(inout id  _Nullable __autoreleasing *)ioValue forKey:(NSString *)inKey error:(out NSError * _Nullable __autoreleasing *)outError{
    NSNumber *handLong  = *ioValue;
    if (handLong.integerValue == 10) {
        return NO;
    }
    return YES;
}

@end
